package memento;

public class MainTest20 {
    public static void main(String[] args) {
        Person person = new Person("tom", 20, "male");
        CareTaker careTaker = new CareTaker();
        careTaker.setMemento(person.createMemento());
        System.out.println(person);
        person.setSex("female");
        System.out.println(person);
        person.callback(careTaker.getMemento());
        System.out.println(person);
    }
}
